d/rules: Explicitly build documentation during build step
authorSimon McVittie <smcv@debian.org>
Sun, 9 Aug 2020 12:05:41 +0000 (13:05 +0100)
committerSimon McVittie <smcv@debian.org>
Sun, 9 Aug 2020 12:05:41 +0000 (13:05 +0100)
By default this is only done during the install step, because gtk-doc
is relatively slow and cannot tell Meson how its dependency tree looks.
However, for GTK that breaks some dependency tracking, leading to
required Docbook files not being generated from their Markdown source.

debian/rules

index 34d08573fac38b0fcc446b6a592b291ebb560437..ed69010ecd1d3131646e82a4b42637b5462045be 100755 (executable)
@@ -159,6 +159,14 @@ endif
 
 override_dh_auto_build:
        dh_auto_build --builddirectory=debian/build/deb
+ifneq ($(filter %-doc,$(built_binaries)),)
+       # Explicitly build the documentation: otherwise it's done as a
+       # side-effect of the install step, which doesn't respect the
+       # dependencies that generate Docbook files from markdown.
+       # https://github.com/mesonbuild/meson/issues/1844
+       # https://github.com/mesonbuild/meson/issues/5793
+       dh_auto_build --builddirectory=debian/build/deb -- gdk4-doc gsk4-doc gtk4-doc
+endif
 ifneq ($(filter %-udeb,$(built_binaries)),)
        dh_auto_build --builddirectory=debian/build/udeb
 endif